package action;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import model.Blt;

import com.opensymphony.xwork2.ActionSupport;

import dao.BltDAO;

public class BltAction extends ActionSupport {
private BltDAO bltDAO;

	public BltDAO getBltDAO() {
	return bltDAO;
}

public void setBltDAO(BltDAO bltDAO) {
	this.bltDAO = bltDAO;
}

	@Override
	public String execute() throws Exception {
		Blt obj=new Blt();
//		obj.setTitle("aaa");
		
		bltDAO.save("insert into BLT (TITLE) values('aaa')");
//		Blt obj=bltDAO.getBlt(1);
//		System.out.println(obj.getTitle());
		return "success";
	}

	public static void main(String[] args) throws Exception {
		ApplicationContext ac=new ClassPathXmlApplicationContext("applicationContext.xml");
		BltAction blta=(BltAction)ac.getBean("BltAction");
		blta.execute();
	}
	
}
